<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PxCollectionExt Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="PhysXLogoBlack.png"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classPxCollectionExt.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classPxCollectionExt-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PxCollectionExt Class Reference<div class="ingroups"><a class="el" href="group__extensions.html">Extensions</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="PxCollectionExt_8h_source.html">PxCollectionExt.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a88b829ff0266f6ff3cead1dd7da9785c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPxCollectionExt.html#a88b829ff0266f6ff3cead1dd7da9785c">releaseObjects</a> (<a class="el" href="classPxCollection.html">PxCollection</a> &amp;collection, bool releaseExclusiveShapes=true)</td></tr>
<tr class="memdesc:a88b829ff0266f6ff3cead1dd7da9785c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes and releases all object from a collection.  <a href="#a88b829ff0266f6ff3cead1dd7da9785c">More...</a><br /></td></tr>
<tr class="separator:a88b829ff0266f6ff3cead1dd7da9785c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af63a23e22b4a3ad678f09a388b29a160"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPxCollectionExt.html#af63a23e22b4a3ad678f09a388b29a160">remove</a> (<a class="el" href="classPxCollection.html">PxCollection</a> &amp;collection, <a class="el" href="group__common.html#gac1fb4b256a5d900d394e89db170a2b79">PxType</a> concreteType, <a class="el" href="classPxCollection.html">PxCollection</a> *to=NULL)</td></tr>
<tr class="memdesc:af63a23e22b4a3ad678f09a388b29a160"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes objects of a given type from a collection, potentially adding them to another collection.  <a href="#af63a23e22b4a3ad678f09a388b29a160">More...</a><br /></td></tr>
<tr class="separator:af63a23e22b4a3ad678f09a388b29a160"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39dbd32faa242e01117cd4ecee3fd2e7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classPxCollection.html">PxCollection</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPxCollectionExt.html#a39dbd32faa242e01117cd4ecee3fd2e7">createCollection</a> (<a class="el" href="classPxPhysics.html">PxPhysics</a> &amp;physics)</td></tr>
<tr class="memdesc:a39dbd32faa242e01117cd4ecee3fd2e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Collects all objects in <a class="el" href="classPxPhysics.html" title="Abstract singleton factory class used for instancing objects in the Physics SDK. ">PxPhysics</a> that are shareable across multiple scenes.  <a href="#a39dbd32faa242e01117cd4ecee3fd2e7">More...</a><br /></td></tr>
<tr class="separator:a39dbd32faa242e01117cd4ecee3fd2e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3e2ad3cfe56c756d78d3a071a064ecf"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classPxCollection.html">PxCollection</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPxCollectionExt.html#ab3e2ad3cfe56c756d78d3a071a064ecf">createCollection</a> (<a class="el" href="classPxScene.html">PxScene</a> &amp;scene)</td></tr>
<tr class="memdesc:ab3e2ad3cfe56c756d78d3a071a064ecf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Collects all objects from a <a class="el" href="classPxScene.html" title="A scene is a collection of bodies and constraints which can interact. ">PxScene</a>.  <a href="#ab3e2ad3cfe56c756d78d3a071a064ecf">More...</a><br /></td></tr>
<tr class="separator:ab3e2ad3cfe56c756d78d3a071a064ecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a39dbd32faa242e01117cd4ecee3fd2e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39dbd32faa242e01117cd4ecee3fd2e7">&#9670;&nbsp;</a></span>createCollection() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classPxCollection.html">PxCollection</a>* PxCollectionExt::createCollection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classPxPhysics.html">PxPhysics</a> &amp;&#160;</td>
          <td class="paramname"><em>physics</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Collects all objects in <a class="el" href="classPxPhysics.html" title="Abstract singleton factory class used for instancing objects in the Physics SDK. ">PxPhysics</a> that are shareable across multiple scenes. </p>
<p>This function creates a new collection from all objects that are shareable across multiple scenes. Instances of the following types are included: <a class="el" href="classPxConvexMesh.html" title="A convex mesh. ">PxConvexMesh</a>, <a class="el" href="classPxTriangleMesh.html" title="A triangle mesh, also called a &#39;polygon soup&#39;. ">PxTriangleMesh</a>, <a class="el" href="classPxHeightField.html" title="A height field class. ">PxHeightField</a>, <a class="el" href="classPxShape.html" title="Abstract class for collision shapes. ">PxShape</a> and <a class="el" href="classPxMaterial.html" title="Material class to represent a set of surface properties. ">PxMaterial</a>.</p>
<p>This is a helper function to ease the creation of collections for serialization.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">physics</td><td>The physics SDK instance from which objects are collected. See <a class="el" href="classPxPhysics.html" title="Abstract singleton factory class used for instancing objects in the Physics SDK. ">PxPhysics</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Collection to which objects are added. See <a class="el" href="classPxCollection.html" title="Collection class for serialization. ">PxCollection</a></dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPxCollection.html" title="Collection class for serialization. ">PxCollection</a>, <a class="el" href="classPxPhysics.html" title="Abstract singleton factory class used for instancing objects in the Physics SDK. ">PxPhysics</a> </dd></dl>

</div>
</div>
<a id="ab3e2ad3cfe56c756d78d3a071a064ecf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3e2ad3cfe56c756d78d3a071a064ecf">&#9670;&nbsp;</a></span>createCollection() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classPxCollection.html">PxCollection</a>* PxCollectionExt::createCollection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classPxScene.html">PxScene</a> &amp;&#160;</td>
          <td class="paramname"><em>scene</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Collects all objects from a <a class="el" href="classPxScene.html" title="A scene is a collection of bodies and constraints which can interact. ">PxScene</a>. </p>
<p>This function creates a new collection from all objects that where added to the specified <a class="el" href="classPxScene.html" title="A scene is a collection of bodies and constraints which can interact. ">PxScene</a>. Instances of the following types are included: <a class="el" href="classPxActor.html" title="PxActor is the base class for the main simulation objects in the physics SDK. ">PxActor</a>, <a class="el" href="classPxAggregate.html" title="Class to aggregate actors into a single broad-phase entry. ">PxAggregate</a>, <a class="el" href="classPxArticulation.html" title="a tree structure of bodies connected by joints that is treated as a unit by the dynamics solver ...">PxArticulation</a> and <a class="el" href="classPxJoint.html" title="a base interface providing common functionality for PhysX joints ">PxJoint</a> (other <a class="el" href="classPxConstraint.html" title="A plugin class for implementing constraints. ">PxConstraint</a> types are not included).</p>
<p>This is a helper function to ease the creation of collections for serialization. The function <a class="el" href="classPxSerialization.html#a0cf59eda36c56e9e66bac0c2b5168094" title="Adds to a collection all objects such that it can be successfully serialized. ">PxSerialization.complete()</a> can be used to complete the collection with required objects prior to serialization.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">scene</td><td>The <a class="el" href="classPxScene.html" title="A scene is a collection of bodies and constraints which can interact. ">PxScene</a> instance from which objects are collected. See <a class="el" href="classPxScene.html" title="A scene is a collection of bodies and constraints which can interact. ">PxScene</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Collection to which objects are added. See <a class="el" href="classPxCollection.html" title="Collection class for serialization. ">PxCollection</a></dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPxCollection.html" title="Collection class for serialization. ">PxCollection</a>, <a class="el" href="classPxScene.html" title="A scene is a collection of bodies and constraints which can interact. ">PxScene</a>, <a class="el" href="classPxSerialization.html#a0cf59eda36c56e9e66bac0c2b5168094" title="Adds to a collection all objects such that it can be successfully serialized. ">PxSerialization.complete()</a> </dd></dl>

</div>
</div>
<a id="a88b829ff0266f6ff3cead1dd7da9785c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88b829ff0266f6ff3cead1dd7da9785c">&#9670;&nbsp;</a></span>releaseObjects()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void PxCollectionExt::releaseObjects </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classPxCollection.html">PxCollection</a> &amp;&#160;</td>
          <td class="paramname"><em>collection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>releaseExclusiveShapes</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Removes and releases all object from a collection. </p>
<p>The Collection itself is not released.</p>
<p>If the releaseExclusiveShapes flag is not set to true, release() will not be called on exclusive shapes.</p>
<p>It is assumed that the application holds a reference to each of the objects in the collection, with the exception of objects that are not releasable (<a class="el" href="classPxBase.html#a38952fcb80e99f1f5dbf774a75ac2c3d" title="Whether the object is subordinate. ">PxBase::isReleasable()</a>). In general, objects that violate this assumption need to be removed from the collection prior to calling releaseObjects.</p>
<dl class="section note"><dt>Note</dt><dd>when a shape is created with PxRigidActor::createShape() or <a class="el" href="classPxRigidActorExt.html#ae708f5ca3fc5f1ce3db14032a89f62b9" title="Creates a new shape with default properties and a list of materials and adds it to the list of shapes...">PxRigidActorExt::createExclusiveShape()</a>, the only counted reference is held by the actor. If such a shape and its actor are present in the collection, the reference count will be decremented once when the actor is released, and once when the shape is released, resulting in undefined behavior. Shape reference counts can be incremented with <a class="el" href="classPxShape.html#a46a4aa44d34de7625129c5d449c26e5d" title="Acquires a counted reference to a shape. ">PxShape::acquireReference()</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">collection</td><td>to remove and release all object from. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">releaseExclusiveShapes</td><td>if this parameter is set to false, release() will not be called on exclusive shapes. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af63a23e22b4a3ad678f09a388b29a160"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af63a23e22b4a3ad678f09a388b29a160">&#9670;&nbsp;</a></span>remove()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void PxCollectionExt::remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classPxCollection.html">PxCollection</a> &amp;&#160;</td>
          <td class="paramname"><em>collection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__common.html#gac1fb4b256a5d900d394e89db170a2b79">PxType</a>&#160;</td>
          <td class="paramname"><em>concreteType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classPxCollection.html">PxCollection</a> *&#160;</td>
          <td class="paramname"><em>to</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Removes objects of a given type from a collection, potentially adding them to another collection. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">collection</td><td>Collection from which objects are removed </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">concreteType</td><td><a class="el" href="structPxConcreteType.html" title="an enumeration of concrete classes inheriting from PxBase ">PxConcreteType</a> of sdk objects that should be removed </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">to</td><td>Optional collection to which the removed objects are added</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classPxCollection.html" title="Collection class for serialization. ">PxCollection</a>, <a class="el" href="structPxConcreteType.html" title="an enumeration of concrete classes inheriting from PxBase ">PxConcreteType</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="PxCollectionExt_8h_source.html">PxCollectionExt.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classPxCollectionExt.html">PxCollectionExt</a></li>
    <li class="footer">Copyright &copy; 2008-2021 NVIDIA Corporation, 2788 San Tomas Expressway, Santa Clara, CA 95051 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a></li>
  </ul>
</div>
</body>
</html>
